<?php
/* @var $file_word array */
/* @var $file_pdf array */

/* @var $var string */

use backend\utils\AppUtil;
use backend\utils\HtmlUtil;
use yii\bootstrap\Html;
use yii\bootstrap\Modal;
use yii\helpers\Url;

$this->registerJsFile(Yii::$app->request->baseUrl . '/js/jquery.js', ['depends' => ['yii\web\JqueryAsset'], 'position' => $this::POS_HEAD]);
?>
<div class="row">
    <div class="col-md-12">
        <div class="widget-body">
            <table class="table table-striped table-bordered">
                <thead style="position: sticky;top: 55px;">
                <tr style="font-weight: bold">
                    <th>工作名称</th>
                    <th>word</th>
                    <th>pdf</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td>中期年度数据采集</td>
                    <td>
                        <?= HtmlUtil::html_a_down($file_word) ?>
                    </td>
                    <td>
                        <?= HtmlUtil::html_a_down($file_pdf) ?>
                    </td>
                    <td>
                        <?php
                        echo Html::a('审计报告', NULL, [
                            "class" => "btn btn-primary btn-space up_files",
                        ]);
                        ?>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
<?php
//创建modal
Modal::begin([
    'id' => 'modal',
    'header' => '<h4 class="modal-title"></h4>',
    //'footer' => '<a href="#" class="btn btn-primary" data-dismiss="modal">Close</a>',
    'size' => 'modal-lg',
    'options' => [
        //'data-backdrop'=>'static',//点击空白处不关闭弹窗
        //'data-keyboard'=>false,
    ],
]);
Modal::end();

$api = Url::toRoute('up-file-alert-view');
$Js = <<<JS
    var load = false;
    $(".up_files").on("click", function () {
        $('#modal .modal-title').html("上传材料（30M以内）");
        $('#modal .modal-body').html('<p align="center"><img src="/images/ico_loading.gif"></p>');
        $.post('{$api}', {
                type:$(this).attr('data-type'),
            },
            function (data) {
                $('#modal .modal-body').html(data);
                $('#modal').modal('show');
            }
        );
    });
JS;
$this->registerJs($Js);
?>


